package com.wu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 武爸爸
 * @create 2020-09-27 0:39
 */
@Configuration
public class ConfigBean {//@@Configuration -- spring applicationContext.xml
    //用什么就 返回什么
    //配置负载均衡实现 RestTemplate
    @Bean
    @LoadBalanced //实现Ribbon负载均衡   //默认是轮询
    public RestTemplate getRestTemplate(){
        return  new RestTemplate();
    }


}
